#pragma once


#include "Renderer.h"
#include "Math.h"

#define WIN32_MEAN_AND_LEAN
#include <Windows.h>

#include <vector>
using std::vector;

class CBaseObject;
class CTile;

class CCamera
{
public:
	/* SINGLETON */
	static CCamera* GetInstance( void );
	static void		DeleteInstance( void );

	/* friends */
	friend CRenderer;

	void Initialize( CBaseObject* pPlayer, int nScreenWidth,
		int nScreenHeight, float fStartingPos = 0.0f );
	void Shutdown( void );
	float UpdateCamera( void );

	bool OnCamera( float fX );
	bool OnCamera( CBaseObject* pOther );

	//void CheckTileCollision( CTile* pTile, RECT* pRect );

	void UpdateCameraPosition( CBaseObject* pObject );

	/* Accessors */
	float GetWorldPosition( void ) const	{	return m_fWorldPosition;	}
	int	  GetScreenWidth( void ) const		{	return m_nScreenWidth;		}
	int	  GetScreenHeight( void ) const		{	return m_nScreenHeight;		}
	
private:
	static CCamera*			s_Instance;

	CCamera(void);
	~CCamera(void);
	CCamera( const CCamera& );
	CCamera& operator= ( const CCamera& );

	vector< CBaseObject* >	m_VisibleObjects;

	/* 0.0f == Map beginning */
	float					m_fWorldPosition;

	int						m_nScreenHeight;
	int						m_nScreenWidth;

	CBaseObject*			m_pPlayer;
};

